# ProgressBar

The `<ProgressBar>` component allows you to render the progress and loading state of something.

## Import

```jsx
import { ProgressBar } from 'bumbag';
```

## Usage

```jsx-live
<ProgressBar value={75} />
```

### Sizes

The progress bar comes with three preset sizes: `small`, `medium` and `large`.

```jsx-live
<ProgressBar value={20} size="small" />
<ProgressBar value={40} />
<ProgressBar value={60} size="medium" />
<ProgressBar value={80} size="large" />
```

### Colors

You can use the `color` prop to add color to your progress bar.

```jsx-live
<ProgressBar value={20} color="secondary" />
<ProgressBar value={40} color="success" />
```

### Max value

By default, the max value of a progress bar is `100`. But you can customize this with the `maxValue` prop.

```jsx-live
<ProgressBar value={100} maxValue={150} />
```

### Animation

```function-live
function Example() {
  const [value, setValue] = React.useState(30);

  return (
    <Stack>
      <Set>
        <Button
          onClick={() => setValue(value => value - 10)}
        >
          -10
        </Button>
        <Button
          onClick={() => setValue(value => value + 10)}
        >
          +10
        </Button>
      </Set>
      <ProgressBar value={value} />
    </Stack>
  );
}
```

## Accessibility

#### Patterns

- `ProgressBar` has a role of `progressbar`
- `ProgressBar` has the `aria-valuenow` attribute set to the current value of the progress bar.
- `ProgressBar` has the `aria-valuemin` attribute set to the minimum value of the progress bar.
- `ProgressBar` has the `aria-valuemax` attribute set to the maximum value of the progress bar.

#### References

- [Using the progressbar role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_progressbar_role)

## Props

### ProgressBar Props

<!-- Automatically generated -->

**<Code fontSize="150" marginRight="major-1">color</Code>** <Code fontSize="100" palette="primary">string</Code> 

Sets the color of the progress bar.

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">maxValue</Code>** <Code fontSize="100" palette="primary">number</Code> 

Sets the max value of the progress bar.

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">size</Code>**  

<Code isBlock palette="primary" fontSize="150" padding="minor-1" marginBottom="major-2">
{`"default"
  | (string & {})
  | "small"
  | "medium"
  | "large"`}
</Code>

Sets the size of the progress bar.

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">value</Code>** <Code fontSize="100" palette="primary">number</Code> 

Sets the value of the progress bar.

<Divider marginTop="major-2" marginBottom="major-2" />

<details><Box use="summary" marginBottom="major-2">Inherits <strong><code>Box</code></strong> props</Box>

**<Code fontSize="150" marginRight="major-1">use</Code>**  

<Code isBlock palette="primary" fontSize="150" padding="minor-1" marginBottom="major-2">
{`string
  | (ComponentClass<any, any> & { useProps: any; })
  | (FunctionComponent<any> & { useProps: any; })`}
</Code>

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">className</Code>** <Code fontSize="100" palette="primary">string</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">children</Code>**  

<Code isBlock palette="primary" fontSize="150" padding="minor-1" marginBottom="major-2">
{`string
  | number
  | boolean
  | {}
  | ReactElement<any, string
  | ((props: any) => ReactElement<any, string
  | ...
  | (new (props: any) => Component<any, any, any>)>)
  | (new (props: any) => Component<...>)>
  | ReactNodeArray
  | ReactPortal
  | ((props: BoxProps) => ReactNode)`}
</Code>

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">alignX</Code>** <Code fontSize="100" palette="primary">&#34;right&#34; | &#34;left&#34; | &#34;center&#34;</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">alignY</Code>** <Code fontSize="100" palette="primary">&#34;top&#34; | &#34;bottom&#34; | &#34;center&#34;</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">variant</Code>** <Code fontSize="100" palette="primary">string</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">colorMode</Code>** <Code fontSize="100" palette="primary">string</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">disabled</Code>** <Code fontSize="100" palette="primary">boolean</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">overrides</Code>**  

<Code isBlock palette="primary" fontSize="150" padding="minor-1" marginBottom="major-2">
{`{
  useCSSVariables?: boolean;
  altitudes?: AltitudesThemeConfig;
  borders?: BordersThemeConfig;
  borderRadii?: BorderRadiiThemeConfig;
  ... 96 more ...;
  Template?: TemplateThemeConfig;
}`}
</Code>

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">elementRef</Code>** <Code fontSize="100" palette="primary">((instance: any) =&#62; void) | RefObject&#60;any&#62;</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">themeKey</Code>** <Code fontSize="100" palette="primary">string</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

</details>
            

### Theming

<Theme component={'ProgressBar'} value={75} overrides={['ProgressBar.styles.base', 'ProgressBar.Indicator.styles.base']} />
